
#if defined (__GNUC__) && defined (__GNUC_MINOR__)
# define GNUC_PREREQ(maj, min) \
         ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
#else
# define GNUC_PREREQ(maj, min) 0
#endif

static inline void flush_icache_range(unsigned long start, unsigned long stop)
{
#if defined(__arm__)
#if GNUC_PREREQ(4, 1)
    __builtin___clear_cache((char *) start, (char *) stop);
#else
	register unsigned long _beg __asm ("a1") = start;
	register unsigned long _end __asm ("a2") = stop;
	register unsigned long _flg __asm ("a3") = 0;
	__asm __volatile__ ("swi 0x9f0002" : : "r" (_beg), "r" (_end), "r" (_flg));
#endif
#endif
}
